<div class="form-group">
	<label class="col-sm-2 control-label">
    <if condition="$config['require']"><span style="color:red">*</span></if>
    <if condition="$config['title']">
        {$config.title}：
        <else/>
        {:L($name)}：
    </if><span class="check-tips"></span></label>
	<input type="text" name="{$name}" id="{$name}" value="{$value|default=''}" class="input-large"/>
	<div class="col-sm-10">
		<input type="file" id="upload_picture_{$name}">
        <div class=" upload-img-box">
    		<notempty name="value">
    			<div class="upload-pre-item"><img src="{$value}" width="80"/></div>
    		</notempty>
        </div>
	</div>
</div>
<script type="text/javascript">

$(document).ready(function(){
    //上传图片
    /* 初始化上传插件 */
    $("#upload_picture_{$name}").uploadify({
        "height"          : 30,
        "swf"             : "__JS__/plugins//uploadify/uploadify.swf",
        "fileObjName"     : "download",
        "buttonText"      : "上传图片",
        "uploader"        : "{:U('File/uploadPicture',array('session_id'=>session_id()))}",
        "width"           : 120,
        'removeTimeout'   : 1,
        'fileTypeExts'    : '*.jpg; *.png; *.gif;',
        "onUploadSuccess" : uploadPicture_{$name},
        'onFallback' : function() {
            // alert('未检测到兼容版本的Flash.');
        }
    });
});
function uploadPicture_{$name}(file, data){
    var data = $.parseJSON(data);
    var src = '';
    if(data.status){
        src = data.url || '__ROOT__' + data.path;
        $("#{$name}").val(src);
        $("#{$name}").parent().find('.upload-img-box').html(
            '<div class="upload-pre-item"><img src="' + src + '" width="80"/></div>'
        );
    } else {
        updateAlert(data.info);
        setTimeout(function(){
            $('#top-alert').find('button').click();
            $(that).removeClass('disabled').prop('disabled',false);
        },1500);
    }
}
</script>